<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>javaspript脚本语言dom📕</title>
	</head>
	<body>
		<h1>JS脚本语言DOM树</h1>
		<h2>JS脚本语言DOM树</h2>
		<h3>JS脚本语言DOM树</h3>
		<h4>JS脚本语言DOM树</h4>
		
		<a href="http://www.taobao.com"target="_blank"name="taobao">淘宝</a>
		<a href="http://www.jd.com"target="_blank"class="jd">京东</a>
		<a href="http://www.pdd.com"target="_blank"id="pdd">平多多</a>
		
		<button onclick="alert(document.getElementsByTagName('a').length)" type="button">数量</button>
		<button onclick="alert(document.getElementsByName('taobao')[0].href)">连接</button>
		<button onclick="alert(document.getElementsByName('taobao')[0].innerText)">内容</button>
	</body>
	<script type="text/javascript">
		//获取页面标题
		//展现窗口标题，alert弹出框
		document.title
		/**window.alert(document.title)
		 * //alert(document.title)
		 */
		
		var h1=document.getElementsByTagName("h1")
		alert(h1[0].innerText)
	</script>
</html>
